//    Copyright (c) 2009 Elwyn Malethan
//
//    This file is part of SeemoreJ.
//
//    SeemoreJ is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    SeemoreJ is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.

//    You should have received a copy of the GNU General Public License
//    along with SeemoreJ.  If not, see <http://www.gnu.org/licenses/>.

package com.malethan.seemorej.taglib;

import com.malethan.seemorej.taglib.elements.Textfield;

public class TextfieldTag extends ElementTag {
    //----------------------------------------------------------------------- Static Properties and Constants
    //----------------------------------------------------------------------- Static Methods
    //----------------------------------------------------------------------- Instance Properties

    String size;
    String maxlength;

    //----------------------------------------------------------------------- Constructors
    //----------------------------------------------------------------------- Getters and Setters

    public void setSize(String size) {
        this.size = size;
    }

    public void setMaxlength(String maxlength) {
        this.maxlength = maxlength;
    }

    //----------------------------------------------------------------------- Instance Methods

    protected String constructElement() {
        Textfield textfield = new Textfield();

        setCommonAttributes(textfield);

        textfield.setSize(size);
        textfield.setMaxlength(maxlength);

        return textfield.toString();
    }

    public void release() {
        super.release();
        this.size = null;
        this.maxlength = null;
    }
}
